<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="javax.persistence.PrePersist"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page import="com.atilim.cargo.model.User"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Kargo Uygulaması</title>
		<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
		<script type="text/javascript" src="extjs/ext-all.js"></script>
		<script type="text/javascript" src="js/Vechile.js"></script>
		<script type="text/javascript" src="js/User.js"></script>
		<script type="text/javascript" src="js/Cargo.js"></script>
		<script type="text/javascript" src="js/Customer.js"></script>
		<script type="text/javascript" src="js/Agency.js"></script>
		<script type="text/javascript" src="js/GMapPanel.js"></script>
	</head>
<script type="text/javascript">
	
Ext.onReady(function() {
    
	Ext.define('CargoTabpanel',{
		extend: 'Ext.tab.Panel',
		alias: 'widget.cargotabpanel',
		listeners:{
        	afterrender:function(v){
        		 v.add({
        			//xtype:'cargovechileform'
        			title: 'Harita',
        			xtype: 'cargovechilecontainer',
        			id: 'harita'
        		
        		});
        	}
        	
        }
	});


	
	var shortestPath = null;
	
    Ext.create('Ext.Viewport', {
        layout: {
            type: 'border',
            padding: 5
        },
        defaults: {
            split: true
        },
  
        items: [{
            xtype: 'box',
            id: 'header',
            region: 'north',
            html: '<h1> Kargo</h1>',
            height: 30
        },{
            region: 'west',
            collapsible: true,
            title: 'İşlemler',
            split: true,
            width: '20%',
            items: [{
            	xtype: 'button',
            	text: 'Harita',
            		handler: function (btn) {
            	
                		var tabpanel = btn.up('viewport').down('tabpanel');
                		if(!tabpanel.getComponent('harita')){
	                		tabpanel.add({
	                			//xtype:'cargovechileform'
	                			title: 'Harita',
	                			xtype: 'cargovechilecontainer',
	                			id: 'harita'
	                		
	                		});
                		}
                	}
            }, {
            	xtype: 'button',
            	text: 'Kullanıcı',
            	handler: function (btn) {
            		var tabpanel = btn.up('viewport').down('tabpanel');
            		if(!tabpanel.getComponent('kullanicilistesi')){
	            		tabpanel.add({
	            			title: 'Kullanıcı Listesi',
	            			xtype: 'usergrid',
	            			id: 'kullanicilistesi'
	            		});
	            	}
            	}
            }, {
            	xtype: 'button',
            	text: 'Kargo Listesi',
            	handler: function (btn) {
            		var tabpanel = btn.up('viewport').down('tabpanel');
            		if(!tabpanel.getComponent('kargolistesi')){
            		tabpanel.add({
            			title: 'Kargo Listesi',
            			xtype: 'cargogrid',
            			id: 'kargolistesi'
            		});
            	}
            		tabpanel.setActiveTab('kargolistesi');
            		}
            }, {
            	xtype: 'button',
            	text: 'Araç Listesi',
            	handler: function (btn) {
            		var tabpanel = btn.up('viewport').down('tabpanel');
            		if(!tabpanel.getComponent('araclistesi')){
	            		tabpanel.add({
	            			title: 'Araç Listesi',
	            			xtype: 'cargovechilegrid',
	            			id: 'araclistesi'
	            		});
	            	}
            		tabpanel.setActiveTab('araclistesi');
            	}
            }]
        },{
            region: 'center',
            xtype: 'cargotabpanel'
        }]
    });
});

</script>
<body>

	
</body>
</html>
